-
-
Notifications
You must be signed in to change notification settings - Fork 398
Add outdate, update and upgrade commands #865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpick and a functional question for @ubidefeo
test/test_outdated.py
Outdated
assert run_command("core install arduino:samd") | ||
assert run_command("lib install ArduinoJson") | ||
|
||
# Verifies only outdate core and library are returned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Verifies only outdate core and library are returned | |
# Verifies only outdated cores and libraries are returned |
cli/outdated/outdated.go
Outdated
func NewCommand() *cobra.Command { | ||
outdatedCommand := &cobra.Command{ | ||
Use: "outdated", | ||
Short: "Lists cores and libraries that can be upgraded\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Short: "Lists cores and libraries that can be upgraded\n", | |
Short: "Lists cores and libraries that can be upgraded", |
This created an empty row in the autocompletion like:
╰─$ ./arduino-cli
board -- Arduino board commands.
burn-bootloader -- Upload the bootloader.
cache -- Arduino cache commands.
compile -- Compiles Arduino sketches.
completion -- Generates completion scripts
config -- Arduino configuration commands.
core -- Arduino core operations.
daemon -- Run as a daemon on port 50051
debug -- Debug Arduino sketches.
help -- Help about any command
lib -- Arduino commands about libraries.
outdated -- Lists cores and libraries that can be upgraded
sketch -- Arduino CLI sketch commands.
update -- Updates the index of cores and libraries
upgrade -- Upgrades installed cores and libraries.
upload -- Upload Arduino sketches.
version -- Shows version number of Arduino CLI.
} | ||
|
||
logrus.Info("Executing `arduino outdated`") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To really see all the outdated cores and libraries, should we launch a commands.UpdateIndex()
and a UpdateLibrariesIndex()
before checking through the local libs and cores? (this is also a functional question for @ubidefeo 🙂 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in Homebrew style this command only returns something after an update
, bit I like the idea that it implicitly runs arduino-cli update
before running
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change that. 👍
test/test_upgrade.py
Outdated
assert run_command("core install arduino:samd") | ||
assert run_command("lib install ArduinoJson") | ||
|
||
assert run_command("upgrade") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be reasonable to add a double check here like you did in the outdated
test, checking if no more stuff to upgrade is present after an upgrade
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's kinda problematic for upgrade
since basically all the strings contain the latest versions of libraries and cores being upgraded, can't really hardcode it.
I can check oudated
commands output though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@silvanocerza and I went through some small cosmetic/usage changes
I tested and it works beautifully
@rsora can you review/approve?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
before creating one)
Add three new commands:
outdated
update
upgrade
Those commands don't exist.
What is the new behavior?
arduino-cli outdated
returns a list of cores and libraries that are outdated, showing the currently installed version and the newly available one.arduino-cli update
downloads and installs the index for installed cores and libraries if new ones are available.arduino-cli upgrade
downloads and installs all available upgrades for installaed cores and libraries.Nope.
None.
See how to contribute